# -*- coding:utf-8 -*-
from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import waitConstants

class WaitSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(WaitSubDirectiveTree, self).__init__(parent)
        self.createWaitSubTreeNode()

    def createWaitSubTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "wait"
        self.setText(0, "等待")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingDirective, "等待")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingForWebElementDirective, "等待元素(Web)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingForWinElementDirective, "等待元素(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingForImageDirective, "等待图像")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingForFileDirective, "等待文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingForOCRTextDirective, "等待文本(OCR)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, waitConstants.WaitingConstants.waitingForWindowDirective, "等待窗口")
